load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//pkg/testutils:buildutil/buildutil.bzl", "disallowed_imports_test")

go_library(
    name = "backupinfo",
    srcs = [
        "backup_metadata.go",
        "manifest_handling.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/backupccl/backupinfo",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ccl/backupccl/backupbase",
        "//pkg/ccl/backupccl/backupencryption",
        "//pkg/ccl/backupccl/backuppb",
        "//pkg/ccl/backupccl/backuputils",
        "//pkg/ccl/storageccl",
        "//pkg/cloud",
        "//pkg/cloud/cloudpb",
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/multitenant/mtinfopb",
        "//pkg/roachpb",
        "//pkg/security/username",
        "//pkg/settings",
        "//pkg/sql",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/dbdesc",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/funcdesc",
        "//pkg/sql/catalog/schemadesc",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/protoreflect",
        "//pkg/sql/sem/tree",
        "//pkg/sql/stats",
        "//pkg/storage",
        "//pkg/util/bulk",
        "//pkg/util/ctxgroup",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/ioctx",
        "//pkg/util/json",
        "//pkg/util/log",
        "//pkg/util/metamorphic",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_klauspost_compress//gzip",
    ],
)

go_test(
    name = "backupinfo_test",
    srcs = [
        "backup_metadata_test.go",
        "main_test.go",
        "manifest_handling_test.go",
    ],
    deps = [
        ":backupinfo",
        "//pkg/base",
        "//pkg/blobs",
        "//pkg/ccl",
        "//pkg/ccl/backupccl/backupbase",
        "//pkg/ccl/backupccl/backupencryption",
        "//pkg/ccl/backupccl/backuppb",
        "//pkg/ccl/backupccl/backuptestutils",
        "//pkg/cloud",
        "//pkg/keys",
        "//pkg/multitenant/mtinfopb",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/sql",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/isql",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/bulk",
        "//pkg/util/hlc",
        "//pkg/util/ioctx",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "@com_github_stretchr_testify//require",
    ],
)

disallowed_imports_test(
    "backupinfo",
    ["//pkg/ccl/backupccl/backupdest"],
)
